## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or (at
## your option) any later version.

## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.

## You should have received a copy of the GNU General Public License
## along with this program (in the file LICENCE-GPLv3.txt).  If not, see
## <http://www.gnu.org/licenses/>.


import sys

class Path:
	
	def __init__(self, filename, points, symbolic_name = None, cliques = None, profile_image = None):
                self.points = points
                self.name = filename
                self.symbolic_name = symbolic_name
                self.cliques = cliques
                self.profile_image = profile_image
                self.minLat = sys.float_info.max
                self.minLon = sys.float_info.max
                self.maxLat = -sys.float_info.max
                self.maxLon = -sys.float_info.max
                self.minTime = points[0][2]
                self.maxTime = points[-1][2]

                # find min and max lat & lon for this path
                for (lon, lat, time, text,) in points:
                        self.minLon = min(self.minLon, lon)
                        self.maxLon = max(self.maxLon, lon)
                        self.minLat = min(self.minLat, lat)
                        self.maxLat = max(self.maxLat, lat)
